package org.bai.algorithm.util;

import java.util.concurrent.ThreadLocalRandom;

public class StringUtil {

    private static final char[] arrayOfLowercaseLetters = new char[] {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};

    public static String generateSimpleString(int size) {
        StringBuilder builder = new StringBuilder();
        ThreadLocalRandom current = ThreadLocalRandom.current();
        for (int i = 0; i < size; i++) {
            builder.append(arrayOfLowercaseLetters[current.nextInt(26)]);
        }
        return builder.toString();
    }
}
